package br.com.megarobot.mega.base;

import javax.jdo.PersistenceManager;

import br.com.megarobot.mega.bean.Mega;
import br.com.megarobot.persistence.DroidPersistenceManagerFactory;

public class MegaDB {
	public void insereMega(Mega vo){
		PersistenceManager pm = DroidPersistenceManagerFactory.get().getPersistenceManager();
		try {
			pm.makePersistent(vo);
		}finally{
			pm.close();
		}
	}
	
	public Mega[] recuperaTodosResultados(){
		PersistenceManager pm = DroidPersistenceManagerFactory.get().getPersistenceManager();
		Mega[] vos;
		try {
			vos = (Mega[])pm.getObjectsById(Mega.class);
		}finally{
			pm.close();
		}
		return vos;
	}
}
